﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class MasterPage_MasterPageBase : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            SqlConnection sqlcon = new SqlConnection();
            sqlcon.ConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
            sqlcon.Open();

            SqlCommand sqlcmd = new SqlCommand("select * from system_status ", sqlcon);

            //Label1.Text = sqlcmd.ExecuteScalar().ToString() ;

            //    if (objCMD.ExecuteScalar() == null)
            //    {
            //为空时的操作
            //    }
            //   else
            //  {
            //        result = objCMD.ExecuteScalar().ToString().Trim();
            //    }


            SqlDataReader reader = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);

            if (reader.Read())
            {

                Label1.Text = reader["hbjmc"].ToString();
            }

            // Label1.Text = reader.GetSqlChars(1).ToString() ;
            reader.Close();

            //SqlDataAdapter sqlsda = new SqlDataAdapter("select * from CODE_REGION ", sqlcon);

            //DataSet ds = new DataSet();
            //sqlsda.Fill(ds, "dat");


            //GridView1.DataSource = ds.Tables["dat"];
            //GridView1.DataBind();

            sqlcon.Close();
        }
        catch (Exception)
        {

            throw;
        }

    }
    protected void Label1_Init(object sender, EventArgs e)
    {
        if (Session["qiyeid"] == null || Session["qiyeid"] == "")
        {
            exit1.Visible=false;
        }

    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Session["qiyeid"] = null;

        Response.Redirect("~/Default.aspx");
    }
}
